package com.ios.enums;
/**
*@Author:WenTao
*@Description:紧急呼叫状态枚举类型
*@Date:9:01 2018/7/21
*/
public enum CallLogEnum {

    CALL_SUCCESS(10,"呼叫第一联系人成功")
    ,CALL_FAIL(00,"呼叫第一联系人失败")
    ,NULL_PHONE(01,"未找到第一联系人信息")
    ,CALL_SUCCESS_RELATIVE(11,"呼叫监护人成功")
    ,CALL_FAIL_RELATIVE(02,"呼叫监护人失败")
    ,NULL_PARAM(03,"参数为空或参数不完整")
    ,NULL_USER(04,"残疾人用户不存在");

    private int state;
    private String stateInfo;

    CallLogEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    /*根据传入的state返回对应的enum值*/
    public static CallLogEnum stateof(int state){
        for (CallLogEnum stateEnum : values()){
            if (stateEnum.getState() == state){
                return stateEnum;
            }
        }
        return null;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }
}
